package com.sl.au.service;

import java.util.List;

import org.springframework.data.domain.Sort.Direction;

import com.sl.au.entity.User;
import com.sl.au.repository.UserRepository;

public interface UserService extends BaseService {
	UserRepository getRepository();

	List<User> getPage(int start, int length, String key, String orderName, String dir);

	int getCount(String key);

	List<User> getUsers(int start, int length, String key, String orderName, String dir);
	
	List<User> getUsersByDept(int start, int length, String key, String deptId,String orderName, String dir);
	
	int getCountByDept(String deptId,String key);
	
	List<User> getUsersByEventTypeAndGrid(int start, int length, String eventTypeId,String gridId, String orderName, String dir);
	
	int getUsersByEventTypeAndGridCount(String eventTypeId,String gridId);

	/**
	 * 删除一个用户时，即把其所有的账号先删除
	 * 
	 * @param userId
	 */
	void delete(String userId);

	/*
	 * 获得相同roleName的用户
	 */
	List<User> userByRole(String roleName);

	int patch(User user, User currentUser);

	int saveUser(User user);

	boolean findByName(String shopName);

	/**
	 * 获取未绑定评级区域人员列表
	 * 
	 * @param start
	 * @param length
	 * @param key
	 * @param orderName
	 * @param dir
	 * @return
	 */
	List<User> getUserByNoGrading(int start, int length, String key, String orderName, Direction dir);

	int getCountByNoGrading(String key);

	/**
	 * 获取已绑定评级区域人员列表
	 * 
	 * @param start
	 * @param length
	 * @param gradingId
	 * @param key
	 * @param orderName
	 * @param dir
	 * @return
	 */
	List<User> getUserByGrading(int start, int length, String gradingId, String key, String orderName, Direction dir);

	int getCountByGrading(String gradingId, String key);

	List<User> getBindUsersPage(int start, int length, String key, String orderName, Direction dir);

	List<User> getBindHierarchyUsersPageBykey(int start, int length, String key, String orderName, Direction dir);

	int getBindHierarchyUsersCount(String key);

	List<User> getUnbindHierarchyUsersPageBykey(int start, int length, String key, String orderName, Direction dir);

	List<User> getUnbindHierarchyUsersPage(int start, int length, String key, String orderName, Direction dir);

	Integer getUnbindHierarchyUserCount(String key);

	List<User> getBindHierarchyUsersPageBykeyAndCon(int start, int length, String key, String con);

	int getBindHierarchyUsersCountByCon(String key, String con);

	int getBindUserCount(String key);

	List<User> getBindUsersPageByKeyAndCon(int start, int length, String key, String con);

	int getBindUserCountByCon(String key, String con);

	List<User> getAllBindHierarchyUsersByKeyAndCon(int start, int length, String con);

	int getAllBindHierarchyUsersCountByKeyAndCon(String con);

	List<User> getBindHierarchyUsersPageNone(int start, int length, String key, String string, Object object);

	int getBindHierarchyUsersCountNone(String key);

	List<User> findBindByConOnly(String con, int start, int length);

	int findBindCountByConOnly(String con);

	int findUsersUnbindHierarchyCountByKeyAndCon(String key, String con);

	List<User> findUsersUnbindHierarchyByKeyAndCon(String key, String con, int start, int length);

	List<User> findUserUnbindHierarchyOnlyKey(String key, int start, int length);

	int findUserUnbindHierarchyCountOnlyKey(String key);

	List<User> findUsersUnbindHierarchyOnlyCon(String con, int start, int length);

	int findUsersUnbindHierarchyCountOnlyCon(String con, int start, int length);

	List<User> findUsersUnbindHierarchyNone(int start, int length);

	int findUsersUnbindHierarchyCountNone();

	List<User> findUsersUnbindEventTypeOnlyCon(int start, int length, String con);

	int findUsersCountUnbindEventTypeOnlyCon(String con);

	List<User> findUsersUnbindEventTypeNone(int start, int length);

	int findUsersCountUnbindEventTypeNone();

	List<User> findUsersUnbindEventTypeByKeyAndCon(int start, int length, String key, String con);

	int findUsersCountUnbindEventTypeByKeyAndCon(String key, String con);

	List<User> findUsersUnbindEventTypeOnlyKey(int start, int length, String key);

	int findUsersCountUnbindEventTypeOnlyKey(String key);

	List<User> findUsersBindEventTypeOnlyCon(int start, int length, String con);

	int findUsersCountBindEventTypeOnlyCon(String con);

	List<User> findUsersBindEventTypeNone(int start, int length);

	int findUsersCountBindEventTypeNone(int start, int length);

	List<User> findUsersBindEventTypeByKeyAndCon(int start, int length, String key, String con);

	int findUsersCountBindEventTypeByKeyAndCon(String key, String con);

	List<User> findUsersBindEventTypeOnlyKey(int start, int length, String key);

	int findUsersCountBindEventTypeOnlyKey(String key);

}
